#! /bin/bash

##############################
## convert to mp3 file
##############################

if ! which mencoder >/dev/null 2>&1 ;then
	echo "No mencoder found"
fi

if [ -z $1 ]; then
	echo "Usage: `basename $0` files"
fi 

for file in $@
do
	if [ ! -e ${file} -o ! -r ${file} ];then
		echo "file error!"
	fi

	mencoder ${file} -oac mp3lame -lameopts aq=3:abr:br=128 -srate 44100 -ovc frameno -o ${file}.mp3 2>/dev/null

done
